package com.alibaba.spider.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author fangyu
 * @version v1.0.0
 * @date 2020/10/4 5:36 下午
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RespBean {
    private Integer status;

    private String msg;

    private Object data;

    public static RespBean ok() {
        return new RespBean(200, "", null);
    }

    public static RespBean ok(String msg) {
        return new RespBean(200, msg, null);
    }

    public static RespBean ok(String msg, Object data) {
        return new RespBean(200, msg, data);
    }

    public static RespBean error() {
        return new RespBean(500, "", null);
    }

    public static RespBean error(String msg) {
        return new RespBean(500, msg, null);
    }

    public static RespBean error(String msg, Object data) {
        return new RespBean(500, msg, data);
    }
}
